package com.iqik.filter.client;

import com.iqik.filter.utils.DubboTraffic;
import com.iqik.filter.utils.RequestHolder;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

@Activate(group = {CommonConstants.CONSUMER})
public class ClientTransportIPFilter implements Filter {
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        System.out.println("============================================ClientTransportIPFilter============================================");
        DubboTraffic.saveFrom(RequestHolder.request());
        return invoker.invoke(invocation);
    }
}
